package exam.test13;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2020-11-18
 * Time: 23:37
 */
public class TestMain {

    public static void main(String[] args) {

    }

    public static int sumNums(int n) {
        return sumRecursive(n, 0);
    }

    public static int sumRecursive(int n, int sum) {
        if (n < 0) {
            return sum;
        }
        sum += n;
        return sumRecursive(n - 1, sum);
    }




}
